<template>
	<view class="content">
		<myheader title="风格化" :user="[7,8,9]" @myenv="onMayEnv"></myheader>
		<navigator url="/pages/list/list"  open-type="reLaunch" >去往list页面</navigator>
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{title}}</text>
		</view>
		<view>{{ text }}</view>
		<view @click="open">开启</view>
		<!-- 这是父子传值的第一种写法 -->
		<!-- <optoggle :flag="flag" @toggleEnv="closeToggle"></optoggle> -->
		<!-- 父子传值的第二中写法
		 -->
		 <optoggle :flag.sync="flag"></optoggle>
		 <view @click="gojump">去购物车页面</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				text:'',
				flag:false,
			}
		},
		onLoad() {
		   console.log('我猜想对不对我瞧瞧567')
		},
		methods: {
         onMayEnv(e) {
			  console.log(e,'王世彪')
			  this.text = e
		 },
		 open() {
			  this.flag = true
		 },
		 gojump() {
			  uni.navigateTo({
			  	url:'/pages/cart/cart?id=1012545&name=wangshibiao'
			  })
		 }
		 // closeToggle() {
			//   this.flag = false
		 // }
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
